//密码是否和上一次相同
function validate() {
    let pwd = $("#password").val();
    let repwd = $("#repassword").val();
    if(pwd == repwd) {
        $("#tishi").html("");
        $("#register").removeAttr("disabled");
    }
    else {
        $("#tishi").html("密码不相同");
        $("#tishi").css("color","red");
        $("#register").attr("disabled","disabled");
    }

};
//清除页面的数据==================================================
//匹配name格式=================================
function sname() {
    let reg = /^[A-z]\w{5,15}$/;
    let name = $("#username").val();
    if (!reg.test(name)){
        $("#name").html("格式不正确");
        $("#name").css("color","red");
        $("#register").attr("disabled","disabled");
    }else {
        $("#name").html("");
        $("#register").removeAttr("disabled");
    }
}
function phonets() {
    let reg = /^1[0-9]{10}$/;
    let phone = $("#phone").val();
    if (!reg.test(phone)){
        $("#phonets").html("格式不正确");
        $("#phonets").css("color","red");
        $("#register").attr("disabled","disabled");
    }else {
        $("#phonets").html("");
        $("#register").removeAttr("disabled");
    }
}
function emailts() {
    let reg = /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
    let eamil = $("#eamil").val();
    if (!reg.test(eamil)){
        $("#emailts").html("格式不正确");
        $("#emailts").css("color","red");
        $("#register").attr("disabled","disabled");
    }else {
        $("#phonets").html("");
        $("#register").removeAttr("disabled");
    }
}